package HDAPI.examples;
import java.io.*;
import java.util.Enumeration;
import java.util.HashMap;

import javax.servlet.*;
import javax.servlet.http.*;

import HDAPI.*;

public class DetectExample4 extends HttpServlet
{
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
    {
    	Utility.initHDAPISettings(this.getServletContext());
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

		HDBase hd = new HDBase();
		String strUA = request.getParameter("ua");
		hd.setDetectVar("user-agent", strUA);
		
		hd.detectAll();
		out.println(hd.getDetect() + "<br>");
		out.println("is mobile: " + hd.isMobile() + "<br>");
		out.println("is tablet: " + hd.isTablet()  + "<br>");
		out.println("is console: " + hd.isConsole()  + "<br>");
		Utility.dumpError(hd, out);
    }

}